package com.xzkydz.app;

import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;

public class MyApp extends Application {

    private static MyApp mInstance;
    public static String zjrStr = 12000+"";
    public static String urlStr;
    public static String portStr;
    public static String appKeyStr;
    public static String numberStr = 1+"";

    @Override
    public void onCreate() {
        super.onCreate();
        getPara();
        mInstance = MyApp.this;
    }

    public static MyApp getInstance() {
        return mInstance;
    }

    /**
     * 获取最近一次使用的参数
     */
    private void getPara(){
        SharedPreferences sharedPreferences = getSharedPreferences(getApplicationContext().getPackageName(), Context.MODE_PRIVATE);
        urlStr = sharedPreferences.getString("urlStr", "http://60.168.132.40:8085/lims-platform/api/operate.shtml");
        portStr = sharedPreferences.getString("portStr", urlStr.substring(20, 24));
        appKeyStr = sharedPreferences.getString("appKeyStr", "xzky");
    }

}
